<?php
declare (strict_types = 1);

namespace app\service\logic\common\tool;

use app\facade\UploadFacade;

final class UploadService
{
    /**
     * 单文件上传逻辑
     *
     * @param $params
     * @param $file
     * @return mixed
     */
    public function upload($params, $file)
    {
        // 本项目都要原名
        $as = true;
        // OSS
        return UploadFacade::ossUploadFile($params, $file['file'], $as);
        // COS
        // return UploadFacade::cosPutObject($params, $file['file'], $as);
        // 本地
        // return UploadFacade::upload($params, $file['file'], $as);
    }
}
